package com.s64.ch06.controller;

import com.s64.ch06.entity.SysRole;
import com.s64.ch06.service.ISysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/roles")
@CrossOrigin
public class SysRoleController {
    @Autowired
    private ISysRoleService sysRoleService;

    @GetMapping
    public List<SysRole> getAll() {
        return sysRoleService.list();
    }
}
